package jtest.com.cpi.cornpp.purchase.program.services;

import com.cpi.cornpp.purchase.program.exception.PurchaseProgramException;
import com.cpi.cornpp.purchase.program.services.PurchaseOrderChargeService;
import com.cpi.cornpp.purchase.program.view.PurchaseOrderChargeView;

import junit.framework.TestCase;

public class PurchaseOrderChargeServiceTest extends TestCase {

	public PurchaseOrderChargeServiceTest(String name) {
		super(name);
	}

	protected void setUp() throws Exception {
		super.setUp();
	}

	protected void tearDown() throws Exception {
		super.tearDown();
	}

	public void testInsert() {
		PurchaseOrderChargeService purchaseOrderChargeService = null;
		PurchaseOrderChargeView purchaseOrderChargeView = null;
		try{
			purchaseOrderChargeService = new PurchaseOrderChargeService();
			purchaseOrderChargeView = new PurchaseOrderChargeView();
			purchaseOrderChargeView.setPurchaseOrderAmount(1100);
			purchaseOrderChargeView.setPurchaseOrderChargeTypeId("1");
			purchaseOrderChargeView.setPurchaseOrderId("60");
			purchaseOrderChargeService.insert(purchaseOrderChargeView);
		}catch(PurchaseProgramException purchaseProgramException){
			fail(purchaseProgramException.getMessage());
		}
	}

	public void testDelete() {
		PurchaseOrderChargeService purchaseOrderChargeService = null;
		PurchaseOrderChargeView purchaseOrderChargeView = null;
		try{
			purchaseOrderChargeService = new PurchaseOrderChargeService();
			purchaseOrderChargeView = new PurchaseOrderChargeView();
			purchaseOrderChargeView.setPurchaseOrderChargeTypeId("1");
			purchaseOrderChargeView.setPurchaseOrderId("60");
			purchaseOrderChargeService.delete(purchaseOrderChargeView);
		}catch(PurchaseProgramException purchaseProgramException){
			fail(purchaseProgramException.getMessage());
		}
	}
}